package mysql

import "gorm.io/gorm"

type Order struct {
	gorm.Model
	UserId  int64   `gorm:"type:int(10);index;not null;comment:用户Id"`
	OrderSn string  `gorm:"type:varchar(36);not null;comment:订单号"`
	PayMent int8    `gorm:"type:tinyint(1);default:0;comment:0 支付宝 1 微信 2银联"`
	Amount  float32 `gorm:"type:decimal(10,2);default:0;comment:订单金额"`
}

func (o *Order) Create() error {
	return DB.Create(&o).Error
}
